<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>FAQ</title>
    <style>
        <!--
        p.MsoNormal {
            mso-style-parent: "";
            margin-bottom: .0001pt;
            text-align: justify;
            text-justify: inter-ideograph;
            font-size: 10.5pt;
            font-family: "Times New Roman";
            margin-left: 0cm;
            margin-right: 0cm;
            margin-top: 0cm
        }

        -->
    </style>
</head>
<body bgcolor=#F1F1FD leftmargin=5><p class="MsoNormal"><span lang="EN-US"
                                                              style="font-size: 12.0pt; color: green">Q</span><span
        lang="EN-US" style="font-size: 12.0pt">: Where does my program input from and output to?</span></p>

<p class="MsoNormal"><span lang="EN-US" style="font-size: 12.0pt; color: red">A</span><span lang="EN-US"
                                                                                            style="font-size: 12.0pt">: Your program should always input from <i><b>stdin</b></i> (standard input) and output to <i><b>stdout</b></i> (standard output). For example, you can use <i>scanf</i> in C or <i>cin</i> in C++ to read, and <i>printf</i> in C or <i>cout</i> in C++ to write.</span>
    <span lang="EN-US" style="font-size: 12.0pt">User programs are not allowed to open and read from/write to any file. You will probably get responded with <font
            color="#FF0000">Runtime Error</font> or <font color="#FF0000">Wrong Answer</font> if you try to do so.&nbsp;</span>
</p>

<p class="MsoNormal"><span lang="EN-US" style="font-size: 12.0pt">More should be noted about I/O operations in C++. Due to their complex underlying implementation models, <i>cin</i> and <i>cout</i> are comparatively slower than <i>scanf</i> and <i>printf</i>.&nbsp;The difference in performance is shown by many experiences to be more significant if the program is compiled by G++. Therefore if a problem has huge input, using cin and cout will possibly lead to <font
        color="#FF0000">Time Limit Exceed</font>.</span></p>

<p class="MsoNormal">��</p>

<p class="MsoNormal"><span style="font-size: 12.0pt" lang="EN-US"><font color="#008000">Q</font>: What are the compilers provided by the judge?</span>
</p>

<p class="MsoNormal"><span style="font-size: 12.0pt" lang="EN-US"><font color="#FF0000">A</font>:&nbsp;Currently five compilers are provided for six language options. For <i>C</i> and <i>C++</i>, MS-VC++ 6.0 is used. For <i>GCC</i>/<i>G++</i>, MinGW GCC/G++ 3.4.2 is used. For <i>Pascal</i>, FreePascal 2.0.0 is used. For <i>Java</i>, JDK 1.5.0 is used. Below are sample solutions to problem 1000 in different languages along with some additional notes.</span>
</p>

<p class="MsoNormal">��</p>

<p class="MsoNormal"><span style="font-size: 12.0pt" lang="EN-US">C and GCC:</span></p>

<p class="MsoNormal"><span lang="EN-US" style="color: #20B000"><font face="Courier New" size="2">#include &lt;stdio.h&gt;</font></span>
</p>

<p class="MsoNormal"><font size="2">��</font></p>

<p class="MsoNormal"><span style="color: #20B000"><font face="Courier New" size="2">int </font></span><font
        face="Courier New" size="2"><span lang="EN-US" style="color: #20B000">main(void)</span></font></p>

<p class="MsoNormal"><span lang="EN-US" style="color: #20B000"><font face="Courier New" size="2">{</font></span></p>

<p class="MsoNormal"><span lang="EN-US" style="color: #20B000"><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp; int
    a, b;</font></span></p>

<p class="MsoNormal"><span lang="EN-US" style="color: #20B000"><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp;
    scanf(&quot;%d %d&quot;, &amp;a, &amp;b);</font></span></p>

<p class="MsoNormal"><span lang="EN-US" style="color: #20B000"><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp;
    printf(&quot;%d\n&quot;, a + b);</font></span></p>

<p class="MsoNormal"><span lang="en-us"><font size="2" color="#20B000" face="Courier New">&nbsp;&nbsp;&nbsp; return
    0;</font></span></p>

<p class="MsoNormal"><span lang="EN-US" style="color: #20B000"><font face="Courier New" size="2">}</font></span></p>

<p class="MsoNormal">��</p>

<p class="MsoNormal"><span style="font-size: 12.0pt" lang="EN-US">C++ and G++:</span></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span lang="EN-US" style="color: #20B000">#include &lt;iostream&gt;</span></font>
</p>

<p class="MsoNormal">��</p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="color: #20B000">using namespace std;</span></font>
</p>

<p class="MsoNormal">��</p>

<p class="MsoNormal"><font face="Courier New" size="2"><font color="#20B000">int</font><span lang="EN-US"
                                                                                             style="color: #20B000">&nbsp;main(void)</span></font>
</p>

<p class="MsoNormal"><font face="Courier New" size="2"><span lang="EN-US" style="color: #20B000">{</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span lang="EN-US" style="color: #20B000">&nbsp;&nbsp;&nbsp; int a, b;</span></font>
</p>

<p class="MsoNormal"><font face="Courier New" size="2"><span lang="EN-US" style="color: #20B000">&nbsp;&nbsp;&nbsp; cin &gt;&gt; a &gt;&gt; b;</span></font>
</p>

<p class="MsoNormal"><font face="Courier New" size="2"><span lang="EN-US" style="color: #20B000">&nbsp;&nbsp;&nbsp; cout &lt;&lt; a + b &lt;&lt; endl;</span></font>
</p>

<p class="MsoNormal"><span lang="en-us"><font size="2" color="#20B000" face="Courier New">&nbsp;&nbsp;&nbsp; return
    0;</font></span></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span lang="EN-US" style="color: #20B000">}</span></font></p>

<p class="MsoNormal">��</p>

<p class="MsoNormal"><span style="font-size: 12.0pt" lang="EN-US">Additional notes for GCC/G++:</span></p>

<p class="MsoNormal"><span style="font-size: 12.0pt" lang="EN-US">For 64-bit integers, both <i>long long int</i> and <i>__int64</i> is supported and they are equivalent. But only &quot;<b><i>%I64d</i></b>&quot; is supported when reading with <i>scanf</i> or writing with <i>printf</i>. &quot;<i>%lld</i>&quot; is not supported because GCC and G++ from MinGW use msvcrt.dll which does not support the C99 standard.</span>
</p>

<p class="MsoNormal"><span style="font-size: 12.0pt" lang="EN-US">(G++ only) As required by the ISO C++ standard, the return type of the <i>main</i> function must be <i><b>int</b></i>, otherwise it will cause <font
        color="#008000">Compile Error</font>.</span></p>

<p class="MsoNormal">��</p>

<p class="MsoNormal"><span style="font-size: 12.0pt" lang="EN-US"><i>Pascal</i>:</span></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span lang="EN-US" style="color: #20B000">Program p1000(Input, Output); </span></font>
</p>

<p class="MsoNormal"><font face="Courier New" size="2"><span lang="EN-US" style="color: #20B000">Var </span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span lang="EN-US" style="color: #20B000">&nbsp;&nbsp;&nbsp; a, b: Integer; </span></font>
</p>

<p class="MsoNormal">�� </p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="color: #20B000" lang="EN-US">Begin</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2"><span lang="EN-US" style="color: #20B000">&nbsp;&nbsp;&nbsp; Readln(a, b); </span></font>
</p>

<p class="MsoNormal"><font face="Courier New" size="2"><span lang="EN-US" style="color: #20B000">&nbsp;&nbsp;&nbsp; Writeln(a + b); </span></font>
</p>

<p class="MsoNormal"><font face="Courier New" size="2"><span style="color: #20B000" lang="EN-US">End.</span></font></p>

<p class="MsoNormal">��</p>

<p class="MsoNormal"><span lang="EN-US" style="font-size: 12.0pt"><i>Java</i>: </span></p>

<p class="MsoNormal"><font face="Courier New" size="2" color="#20B000"><span
        lang="EN-US">import java.util.*;</span></font></p>

<p class="MsoNormal">��</p>

<p class="MsoNormal"><font face="Courier New" size="2" color="#20B000"><span
        lang="EN-US">public class Main</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2" color="#20B000"><span lang="EN-US">{</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2" color="#20B000"><span lang="EN-US">&nbsp;&nbsp;&nbsp; public static void main(String args[])</span></font>
</p>

<p class="MsoNormal"><font face="Courier New" size="2" color="#20B000"><span
        lang="EN-US">&nbsp;&nbsp;&nbsp; {</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2" color="#20B000"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Scanner cin = new Scanner(System.in);</span></font>
</p>

<p class="MsoNormal"><font face="Courier New" size="2" color="#20B000"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int a = cin.nextInt(), b = cin.nextInt();</span></font>
</p>

<p class="MsoNormal"><font face="Courier New" size="2" color="#20B000"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println(a + b);</span></font>
</p>

<p class="MsoNormal"><font face="Courier New" size="2" color="#20B000"><span
        lang="EN-US">&nbsp;&nbsp;&nbsp; }</span></font></p>

<p class="MsoNormal"><font face="Courier New" size="2" color="#20B000"><span lang="EN-US">}</span></font></p>

<p class="MsoNormal">��</p>

<p class="MsoNormal"><span style="font-size: 12.0pt" lang="EN-US">Additional notes for Java:</span></p>

<p class="MsoNormal"><span style="font-size: 12.0pt" lang="EN-US">A Java program must be submitted as a single source file. Apart from complying with restrictions imposed on all submitted programs, it must start execution in a static method named <i>main</i> in a class named <i>Main</i>, otherwise <font
        color="#008000">Compile Error</font> will be caused. Except for the aforementioned restrictions, you can implement and&nbsp; instantiate as many classes as needed. </span>
</p>

<p class="MsoNormal"><span style="font-size: 12.0pt"
                           lang="EN-US">A program for JDK 1.4 is provided here for reference.</span></p>

<p class="MsoNormal"><font color="#20B000" face="Courier New" size="2"><span lang="EN-US">import java.io.*;<br>import java.util.*;<br><br>public class Main<br>{<br>&nbsp;&nbsp;&nbsp; public static void main (String args[]) throws Exception<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BufferedReader stdin = <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; new BufferedReader(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; new InputStreamReader(System.in));<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String line = stdin.readLine();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; StringTokenizer st = new StringTokenizer(line);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int a = Integer.parseInt(st.nextToken());<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int b = Integer.parseInt(st.nextToken());<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println(a + b);<br>&nbsp;&nbsp;&nbsp; }<br>}</span></font>
</p>

<p class="MsoNormal">��</p>

<p class="MsoNormal"><span lang="EN-US" style="font-size: 12.0pt; color: green">Q</span><span lang="EN-US"
                                                                                              style="font-size: 12.0pt">: </span><font
        size="3">Can I use shortcut keys when submitting?</font></p>

<p class="MsoNormal"><span lang="EN-US" style="font-size: 12.0pt; color: red">A</span><span lang="EN-US"
                                                                                            style="font-size: 12.0pt">: </span><span
        style="font-size: 12.0pt">Here are the shortcut keys defined in the submit page:</span></p>
<table border="0" width="328">
    <tr>
        <td width="64"><p class="MsoNormal"><font color="#FF00FF" size="3">ALT+s</font></td>
        <td width="250"><p class="MsoNormal"><font size="3">Submit button</font></td>
    </tr>
    <tr>
        <td width="64"><p class="MsoNormal"><font color="#FF00FF" size="3">ALT+u </font></td>
        <td width="250"><p class="MsoNormal"><font size="3">User ID field, if you haven't logged in</font></td>
    </tr>
    <tr>
        <td width="64"><p class="MsoNormal"><font color="#FF00FF" size="3">ALT+l </font></td>
        <td width="250"><p class="MsoNormal"><font size="3">Language options</font></td>
    </tr>
    <tr>
        <td width="64"><p class="MsoNormal"><font color="#FF00FF" size="3">ALT+p </font></td>
        <td width="250"><p class="MsoNormal"><font size="3">Problem ID field</font></td>
    </tr>
</table>
<p class="MsoNormal">��</p>

<p class="MsoNormal"><span lang="EN-US" style="font-size: 12.0pt; color: green">Q</span><span style="font-size: 12.0pt"
                                                                                              lang="EN-US">: How is my program judged?</span>
</p>

<p class="MsoNormal"><span lang="EN-US" style="font-size: 12.0pt; color: red">A</span><span style="font-size: 12.0pt"
                                                                                            lang="EN-US">: The judge first saves your submitted program to a file then tries to compile with the compiler corresponding to your selected language option. If compilation fails, <font
        color="#008000">Compile Error</font> is returned. The judge then runs your program, feeds the input data to it through the handle to its standard input and does the timing at the same time. Input data are stored in one or more files. Each file is used for judging your program exactly once. During the execution, if the judge finds that your program's running state meet the criteria for <font
        color="#FF0000">Runtime Error</font>, <font color="#FF0000">Time Limit Exceed</font>, </span><font
        color="#FF0000"><span lang="EN-US" style="font-size: 12.0pt">Memory Limit Exceed</span></font><span lang="EN-US"
                                                                                                            style="font-size: 12.0pt"><font
        color="#FF0000"> </font>or </span><font color="#FF0000"><span lang="EN-US" style="font-size: 12.0pt">Output Limit Exceed</span></font><span
        lang="EN-US" style="font-size: 12.0pt">, the result is immediately returned. No further judging will be done. This implies that in the cases of TLE or MLE, it cannot be told whether your program will eventually produce all correct answers given sufficient resources. When your program finishes one input file and produces some output which is saved to an output file, the judge compares the output file against the file containing the corresponding expected output or uses a special judge program to check the output. If the output is incorrect and does not meet the criteria for Presentation Error, <font
        color="#FF0000">Wrong Answer</font> is returned. Otherwise the judge will run your program again to deal with the next input file. After finishing all input files, if your program has avoided the appearance of all six results mentioned above but produced some output that meets the criteria for <font
        color="#FF0000">Presentation Error</font>, this result is returned. Otherwise </span><span lang="EN-US"
                                                                                                   style="font-size: 12.0pt; color: blue">Accepted</span><span
        lang="EN-US" style="font-size: 12.0pt"> is returned.</span></p>

<p class="MsoNormal">��</p>

<p class="MsoNormal"><span lang="EN-US" style="font-size: 12.0pt; color: green">Q</span><span lang="EN-US"
                                                                                              style="font-size: 12.0pt">: What are the meanings of the judge's replies?</span>
</p>

<p class="MsoNormal"><span lang="EN-US" style="font-size: 12.0pt; color: red">A</span><span lang="EN-US"
                                                                                            style="font-size: 12.0pt">: Here is a list of the judge's replies with their common abbreviations and exact meanings:</span>
</p>

<p class="MsoNormal"><span lang="EN-US" style="font-size: 12.0pt"><font color=green>Waiting</font>: Your program is being judged or waiting to be judged.</span>
</p>

<p class="MsoNormal">��</p>

<p class="MsoNormal"><span lang="EN-US" style="font-size: 12.0pt; color: blue">Accepted</span><span lang="EN-US"
                                                                                                    style="font-size: 12.0pt"><span
        style="color: blue"> (AC)</span>: Congratulations! Your program has produced the correct output!</span></p>

<p class="MsoNormal">��</p>

<p class="MsoNormal"><span lang="EN-US" style="font-size: 12.0pt"><font color="#FF0000">Presentation Error (PE)</font>: Your program's output format is not exactly the same as required by the problem, although the output is correct. This usually means the existence of omitted or extra blank characters (white spaces, tab characters and/or new line characters) between any two non-blank characters, and/or blank lines (a line consisting of only blank characters) between any two non-blank lines. Trailing blank characters at the end of each line and trailing blank lines at the of output are not considered format errors. Check the output for spaces, blank lines, etc. against the problem's output specification.</span>
</p>

<p class="MsoNormal">��</p>

<p class="MsoNormal"><font color="#FF0000"><span lang="EN-US" style="font-size: 12.0pt">Wrong Answer</span></font><span
        lang="EN-US" style="font-size: 12.0pt"><font color="#FF0000"> (WA)</font>: Your program does not produce the correct output. Special judge programs will possibly return Wrong Answer in place of Presentation Error for simplicity and robustness.</span>
</p>

<p class="MsoNormal">��</p>

<p class="MsoNormal"><font color="#FF0000"><span lang="EN-US" style="font-size: 12.0pt">Runtime Error</span></font>